/**
 * Project: Utilities <br>
 * Package: org.leumasjaffe.util
 */
package org.leumasjaffe.util;

import org.eclipse.jdt.annotation.NonNullByDefault;
import org.eclipse.jdt.annotation.Nullable;

/**
 * Class .UnorderedPair in file UnorderedPair.java <br>
 * 
 * @author leumasjaffe
 * Created on: Nov 8, 2012
 * 
 */
@NonNullByDefault
public class UnorderedPair<T> extends Pair<T, T> {
	
	@Override
	public boolean equals(@Nullable Object o) {
		if (this == o) {
			return true;
		}
		if (o instanceof Pair) {
			return o.equals(this) ||
					(this.getSecond().equals(((Pair<?, ?>) o).getFirst()) && 
							this.getFirst().equals(((Pair<?, ?>) o).getSecond()));
		}
		return false;
	}
}
